class Solution(object):
    def integerBreak(self, n):
        """
        :type n: int
        :rtype: int
        """
        def split(k):
            base = n // k
            left = n % k
            if left == 0:
                return base ** k
            else:
                return base ** (k - left) * (base + 1) ** left

        max_val = 1
        for k in range(2, n + 1):
            max_val = max(max_val, split(k))
        return max_val

data = Solution()
n = 10
print(data.integerBreak(n))